Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

230
Vistas
angular e2e tests - json object forEach method used in data driven tests throw "not a function error"

Have a data.json file and trying to use json data in e2e tests as given in below example. https://www.c-sharpcorner.com/article/data-driven-testing-in-protractor/

The example works fine with github version. Same implementation throw below error with Angular 12 and latest version. It seems the typescript version is unable to recognize the data object as array type. Not sure where to look at. Any help on this is apprecicated.

  • TypeError: calcJson.forEach is not a function

Below is the tsconfig setting:

"compilerOptions": { "baseUrl": "./", "downlevelIteration": true, "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "module": "es2020", "moduleResolution": "node", "experimentalDecorators": true, "importHelpers": true, "target": "es2015", "resolveJsonModule": true, "esModuleInterop": true, "typeRoots": [ "node_modules/@types" ], "lib": [ "es2018", "dom" ],

Package.json file:

"@angular-devkit/build-angular": "~12.2.7", "@angular/cli": "~12.2.7", "@angular/compiler-cli": "~12.2.7", "@angular/language-service": "~12.2.7", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "concat": "^1.0.3", "fs-extra": "^8.1.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "mini-css-extract-plugin": "^2.3.0", "protractor": "~7.0.0", "protractor-beautiful-reporter": "^1.3.6", "ts-node": "~7.0.0", "tslint": "~6.1.0", "typescript": "~4.3.5"

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda